%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left

    subgraph "Buckets for queries/super-simple/many-field-aliases-and-mismatched-fields"
    Bucket0("Bucket 0 (root)<br /><br />1: <br />ᐳ: 9, 10, 24, 11, 13<br />2: PgSelect[8]<br />3: PgSelectRows[18]"):::bucket
    Bucket1("Bucket 1 (listItem)<br /><br />ROOT __Item{1}ᐸ18ᐳ[19]"):::bucket
    Bucket2("Bucket 2 (nullableBoundary)<br />Deps: 20<br /><br />ROOT PgSelectSingle{1}ᐸforumsᐳ[20]"):::bucket
    end
    Bucket0 --> Bucket1
    Bucket1 --> Bucket2

    %% plan dependencies
    PgSelect8[["PgSelect[8∈0] ➊<br />ᐸforumsᐳ"]]:::plan
    Object11{{"Object[11∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
    Lambda13{{"Lambda[13∈0] ➊<br />ᐸincludeArchivedConditionᐳ<br />More deps:<br />- Constantᐸ[ undefined, 'INHERIT' ]ᐳ[24]"}}:::plan
    Object11 & Lambda13 --> PgSelect8
    Access9{{"Access[9∈0] ➊<br />ᐸ2.pgSettingsᐳ"}}:::plan
    Access10{{"Access[10∈0] ➊<br />ᐸ2.withPgClientᐳ"}}:::plan
    Access9 & Access10 --> Object11
    __Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ"]:::plan
    __Value2 --> Access9
    __Value2 --> Access10
    PgSelectRows18[["PgSelectRows[18∈0] ➊"]]:::plan
    PgSelect8 --> PgSelectRows18
    __Item19[/"__Item[19∈1]<br />ᐸ18ᐳ"\]:::itemplan
    PgSelectRows18 ==> __Item19
    PgSelectSingle20{{"PgSelectSingle[20∈1]<br />ᐸforumsᐳ"}}:::plan
    __Item19 --> PgSelectSingle20
    PgClassExpression22{{"PgClassExpression[22∈2]<br />ᐸ__forums__.”id”ᐳ"}}:::plan
    PgSelectSingle20 --> PgClassExpression22
    PgClassExpression23{{"PgClassExpression[23∈2]<br />ᐸ__forums__.”name”ᐳ"}}:::plan
    PgClassExpression22 o--o PgClassExpression23

    %% define steps
    classDef bucket0 stroke:#696969
    class Bucket0,__Value2,PgSelect8,Access9,Access10,Object11,Lambda13,PgSelectRows18 bucket0
    classDef bucket1 stroke:#00bfff
    class Bucket1,__Item19,PgSelectSingle20 bucket1
    classDef bucket2 stroke:#7f007f
    class Bucket2,PgClassExpression22,PgClassExpression23 bucket2

